/* GMAttributeImages.js <?php
#   --------------------------------------------------------------
#   GMAttributeImages.js 2011-08-29 gambio
#   Gambio GmbH
#   http://www.gambio.de
#   Copyright (c) 2011 Gambio GmbH
#   Released under the GNU General Public License (Version 2)
#   [http://www.gnu.org/licenses/gpl-2.0.html]
#   --------------------------------------------------------------
?>*/
/*<?php
if($GLOBALS['coo_debugger']->is_enabled('uncompressed_js') == false)
{
?>*/
eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('$(g).h(0(){4 b=9 5();b.6();$(".7").i("j",0(){8(!$(1).k("l")){4 a=9 5();a.6()}})});0 5(){1.6=0(){4 b=\'\',3=\'\';$(\'.7\').c(0(){8($(1).2(\'m\')==n){b+=$(1).2(\'d\')+\',\';3+=$(1).2(\'e\')+\',\'}});8(b==\'\'){$(\'.7\').c(0(){b+=$(1).2(\'d\')+\',\';3+=$(1).2(\'e\')+\',\'})}$(\'#f\').o(\'p.q?r=s&t=\'+b+\'&u=\'+3,0(a){$(\'#f\').v(a)})}}',32,32,'function|this|attr|gm_values_ids|var|GMAttributeImages|get_attribute_images|gm_attr_calc_input|if|new|||each|name|value|gm_attribute_images|document|ready|bind|change|hasClass|properties_values_select_field|checked|true|load|gm_ajax|php|module|attribute_images|options_ids|values_ids|html'.split('|'),0,{}));
/*<?php
}
else
{
?>*/
$(document).ready(function(){

	var attr_img = new GMAttributeImages();
	attr_img.get_attribute_images();

	$(".gm_attr_calc_input").bind("change", function(){
		if(!$(this).hasClass("properties_values_select_field")){
			var attr_img = new GMAttributeImages();
			attr_img.get_attribute_images();
		}
	});
});


function GMAttributeImages()
{
	this.get_attribute_images = function()
	{
		var gm_options_ids = '';
		var gm_values_ids = '';

		$('.gm_attr_calc_input').each(function()
		{
			if($(this).attr('checked') == true)
			{
				gm_options_ids += $(this).attr('name') + ',';
				gm_values_ids += $(this).attr('value') + ',';
			}
		});

		if(gm_options_ids == '')
		{
			$('.gm_attr_calc_input').each(function()
			{
				gm_options_ids += $(this).attr('name') + ',';
				gm_values_ids += $(this).attr('value') + ',';
			});
		}

		$('#gm_attribute_images').load('gm_ajax.php?module=attribute_images&options_ids=' + gm_options_ids + '&values_ids=' + gm_values_ids,
				function(attribute_images)
				{
					$('#gm_attribute_images').html(attribute_images);
				}
		);
	}
}
/*<?php
}
?>*/
